import * as types from '@/store/mutation-types'

export default {
  state: {
    loading: false,     // 通用加载状态
    dialogShow: false,  // 通用弹出框-显示/隐藏状态
    transitionName: 'slide-right'
  },
  getters: {
    transitionName: state => {
      return (state.route.meta.timeStamp && (state.route.meta.timeStamp < state.route.from.meta.timeStamp)) ? 'slide-right' : 'slide-left'
    }
  },
  mutations: {
    [types.SET_LOADING] (state, bool) {
      state.loading = bool
    },
    [types.SET_DLG_SHOW] (state, bool) {
      state.dialogShow = bool
    },
    [types.SET_TRANSITION_NAME] (state, data) {
      state.transitionName = data
    }
  },
  actions: {
  }
}
